package com.bdqn.demo.controller;

import com.bdqn.demo.pojo.Menu;
import com.bdqn.demo.service.MenuService;
import com.bdqn.demo.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/getMenu")
    public Result getMenu() {
        List<Menu> menuList = menuService.getMenu();
        return Result.ok("true", menuList);
    }

}
